package com.view;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class userPanel extends JPanel implements MouseListener{
	
	JLabel jl_photo;
	JLabel jl_username;
	int photoNum;
	String name;
	int ip;
	
	public userPanel(int photoNum,String name){
		
		this.photoNum=photoNum;
		this.name=name;
	
		
		
		String imagePath = "Images/photo" + photoNum + ".png";
		ImageIcon image = new ImageIcon(imagePath);
		jl_photo = new JLabel(image);
		
		jl_username = new JLabel(name);
		jl_username.setFont(new Font(null, Font.ITALIC, 20));
		jl_username.setForeground(Color.orange);
		jl_photo.addMouseListener(this);
		jl_username.addMouseListener(this);
		this.setLayout(null);
		this.add(jl_photo);
		this.add(jl_username);
		jl_photo.setBounds(0, 0, 80, 80);
		jl_username.setBounds(20, 85, 50 , 25);

		this.setOpaque(false);
		this.setSize(80, 110);
		
		
	}

	
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub
		System.out.println("press me");
	}

	
	public void mouseEntered(MouseEvent arg0) {
		
//		jl_username.setForeground(Color.blue);
//		jl_username.setFont(new Font(null, Font.ITALIC, 25));
	
	}


	public void mouseExited(MouseEvent arg0) {
//		jl_username.setForeground(Color.orange);
//		jl_username.setFont(new Font(null, Font.ITALIC, 20));
	}
	
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	
}
